package com.monkey.toolsshop.user.enums;

/**
 * 用户类型枚举类型
 * */
public enum EnumUserType {

    CUSTOM(0,"用户"),
    ADMIN(1,"后台管理员");

    private Integer code;
    private String name;

    private EnumUserType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static EnumUserType getEnum(Integer code) {
        for (EnumUserType enumValue : EnumUserType.values()) {
            if (enumValue.getCode().equals(code)) {
                return enumValue;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
